<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
    <style>
        *{
            padding:0;margin: 0;
        }
        .bg {
            position: fixed;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            background: #333;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        img.bg-img{
            width: 500px;
        }
        img.main-img {
            width: 100%;
        }
    </style>
</head>

<body>
    <div id="app">
        <div>
            <img @click="handleClick" src="images/bg.jpg" alt="" class="main-img">
            <div class="bg" v-if="isBg"  @click="handleBg">
                <img src="images/bg.jpg" class="bg-img" >
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    isBg: false
                }
            },
            methods:{
                handleClick(){
                    this.isBg=true
                },
                handleBg(){
                    this.isBg=false;
                }
            }
        })
    </script>
</body>

</html>